{extend name="public/base" /}
{block name="header_title"}会员查找{/block}
{block name="main"}
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-xs-12">
                <div class="card">
                    <div class="card-header">
                        <h4>请输入要查找手机号</h4>
                    </div>
                    <div class="card-body clearfix">
                        <form method="get" action="show.html" class="clearfix">
                            <div class="form-group col-md-10">
                                <input class="form-control mobile" value="{$mobile?$mobile:''}" type="text" id="example-nf-mobile" name="m" oninput="value=value.replace(/[^\d]/g,'')">
                            </div>
                            <div class="form-group col-md-2">
                                <button class="btn btn-default" type="submit">查找</button>
                            </div>
                        </form>
                    </div>
                </div>

            </div>
        </div>
        {if condition="count($user_info)>0"}
        <div class="row">
            <div class="col-xs-12">
                <div class="card">
                    <div class="card-body">
                        <table class="table table-bordered">
                            <tr>
                                <th>姓名</th>
                                <th>手机号</th>
                                <th>总积分</th>
                                <th>添加时间</th>
                            </tr>
                            <tr>
                                <td>{$user_info.name}</td>
                                <td>{$user_info.mobile}</td>
                                <td>{$user_info.total_cost}</td>
                                <td>{$user_info.create_time|date='Y-m-d H:i:s'}</td>
                            </tr>
                        </table>
                        <div class="clearfix">
                            <p><code>历史记录</code></p>
                            <ul>
                                {foreach $user_logs as $log}
                                <li>{$log.time|date='Y-m-d H:i:s'} {$log.des}  {$log.cost!=0?$log.cost:''}</li>
                                {/foreach}

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {else}
        {if condition="$mobile != ''"}
        <div class="row">
            <div class="col-xs-12">
                <div class="card">

                    <div class="card-body">
                        <div class="text-center">
                            <h4> {$error}</h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {/if}
        {/if}


    </div>

</main>
{/block}
{block name="js"}
<script type="text/javascript" src="__js__/base.64.js"></script>
<script src="__js__/view/user/add.js"></script>
{/block}